package fr.mmt.gisfizz.repository;

import fr.mmt.gisfizz.entity.Workspace;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Workspace repository.
 *
 * @author Mathieu MAST
 */
public interface WorkspaceRepository extends JpaRepository<Workspace, String> {

    @Query("select e from Workspace e WHERE lower(e.name) like :search OR lower(e.label) like :search")
    public Page<Workspace> search(@Param("search") String search, Pageable page);
}
